package com.lion.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;

public class LionInputTag extends LionSimpleTag {
	protected String id;
	protected String onclick;
	protected String name;
	protected String value;
	protected String style;
	protected boolean required = false;// 是否必填
	protected String prompt;// 显示文字
	protected Integer maxlength;// 最大长度

	public HttpServletRequest getRequest(){
		HttpServletRequest request = (HttpServletRequest)((PageContext)this.getJspContext()).getRequest();
		return request;
	}
	
	public String getContextPath(){
		return getRequest().getContextPath();
	}
	
	public Integer getMaxlength() {
		return maxlength;
	}

	public void setMaxlength(Integer maxlength) {
		this.maxlength = maxlength;
	}

	/**
	 * @return the onclick
	 */
	public String getOnclick() {
		return onclick;
	}

	/**
	 * @param onclick
	 *            the onclick to set
	 */
	public void setOnclick(String onclick) {
		this.onclick = onclick;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Boolean getRequired() {
		return required;
	}

	public void setRequired(Boolean required) {
		this.required = required;
	}

	public String getPrompt() {
		return prompt;
	}

	public void setPrompt(String prompt) {
		this.prompt = prompt;
	}

	public void setRequired(boolean required) {
		this.required = required;
	}

}
